﻿using DevExpress.XtraReports.UI;

namespace ReportDesignerServer.Common
{
    public static class ReportHelper
    {

        private static string FileExtension = ".repx";
        private static string ReportDirectory= Path.Combine(Environment.CurrentDirectory, "Reports");
        public static XtraReport GetReport(string fileName)
        {
            var filePath = Path.Combine(ReportDirectory, fileName + FileExtension);
            XtraReport report = new XtraReport();
            try
            {
                report.LoadLayout(filePath);
                NLogHelper.GetLog().Error("读取报表文件");
            }
            catch (Exception ex)
            {
                NLogHelper.GetLog().Error("读取报表文件失败："+ ex);
            }
           
            return report;
        }
    }
}
